home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of MacTutor - S…e Code for Volumes 1 to 5
/
The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin
/
Source Code
/
#51 (Dec 89)
/
AACK Folder
/
lowlevelatprocs.p
< prev
next >
Wrap
Text File
|
1989-03-30
|
2KB
|
90 lines
unit LowLevelATProcs;
interface
uses
AppleTalk, Globals;
procedure XCompletionRoutine;
function NTTExists (ntt2Confirm: EntityName; var theAddress: AddrBlock): OSErr;
procedure DrawConfirmString;
procedure DrawLookUpString;
implementation
procedure InlineRoutine;
inline
$213C, $FFFF, $FFFF; { MOVEA.L #-1,-(A0) set CallDone field}
procedure XCompletionRoutine;
{When routine is called A0 = ptr to ParamBlock}
begin
InlineRoutine;
end;
function NTTExists (ntt2Confirm: EntityName; var theAddress: AddrBlock): OSErr;
{This function test whether or not an NTT exists at a certain address and}
{ returns its new address if it 'moved'}
var
err: OSErr;
localMPPPb: MPPParamBlock;
begin
with localMPPPb do
begin
ioCompletion := nil;
{$IFC TALK_DEBUG }
interval := 6;
count := 2;
{$ELSC}
interval := 10;
count := 10;
{$ENDC}
entityPtr := @ntt2Confirm; {NTT to confirm}
confirmAddr := theAddress; {address to confirm}
err := PConfirmName(@localMPPPb, SYNC);
NTTExists := err;
if err = nbpConfDiff then
{If the NTT 'moved' then return its new address}
theAddress.aSocket := newSocket;
end;
end;
procedure DrawConfirmString;
{This proc draws the result of the last ConfirmName call}
{It assumes that the current port is the user window}
begin
with ConfirmStringPos do
begin
EraseRect(ConfirmStringRect);
MoveTo(h, v);
DrawString('Confirm Status = ');
DrawString(ConfirmString);
end;
end;
procedure DrawLookUpString;
{This proc draws the result of the last LookUpName call}
{It assumes that the current port is the user window}
begin
with LookUpStringPos do
begin
EraseRect(LookUpStringRect);
MoveTo(h, v);
DrawString('LookUp Status = ');
DrawString(LookUpString);
end;
end;
end.